﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyAttribute
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }

    [TMessg]
    class myclass { }
    [AttributeUsage(AttributeTargets.All)]//3.设置可用于哪些对象
    public class TMessgAttribute : Attribute//1.定义类TMessg加上后缀TMessgAttribute 2.继承Attribute。
    {
        public TMessgAttribute() { }

        /// <param name="createTime">创建时间</param>
        /// <param name="createName">创建人</param>
        public TMessgAttribute(string createTime, string createName, string mess)
        {
            this._createName = createName;
            this._createTime = createTime;
            this._mess = mess;
        }

        private string _createTime;
        public string createTime
        {
            get { return _createTime; }//4.只能有get方法
        }
        private string _createName;
        public string createName
        {
            get { return _createName; }
        }
        private string _mess;
        public string mess { get { return _mess; } }

        public string modifyTime { get; set; }
    }
}
